package com.caozhi.mspeoject.nb_message.service.admin.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.caozhi.mspeoject.nb_message.mapper.MediaMapper;
import com.caozhi.mspeoject.nb_message.mapper.MessageMapper;
import com.caozhi.mspeoject.nb_message.service.admin.AdminMessageService;
import com.woniuxy.boot.common.bean.Message;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminMessageServiceImpl extends ServiceImpl<MessageMapper, Message> implements AdminMessageService {
    @Autowired
    private MessageMapper messageMapper;
    @Autowired
    private MediaMapper mediaMapper;
    @Override
    public List<Message> getEsMessages() {
        return messageMapper.selectList(null);
    }

    @Override
    public List<Message> getMessagesByConditon(QueryWrapper<Message> wrapper) {
        return messageMapper.selectList(wrapper);
    }

    @Override
    public void addMessage(Message message) {
        messageMapper.insert(message);
    }

}
